﻿Public Class TablesMortaliteIntegreesFactory
    Implements ITablesMortaliteFactory


    Public ReadOnly Property Item(ByVal TableName As String) As ITableMortalite Implements ITablesMortaliteFactory.Item
        Get
            Dim Result As ITableMortalite = Nothing
            Select Case TableName
                Case TD_88_90.Nom
                    Result = TD_88_90
                Case TF_00_02.Nom
                    Result = TF_00_02
                Case TH_00_02.Nom
                    Result = TH_00_02
                Case NA_Empr_H.Nom
                    Result = NA_Empr_H
                Case NA_Empr_F.Nom
                    Result = NA_Empr_F
            End Select
            Return Result
        End Get
    End Property

    Private m_TablesDisponibles As List(Of String)
    Public ReadOnly Property NomsTablesDisponibles As System.Collections.Generic.List(Of String) Implements ITablesMortaliteFactory.NomsDisponibles
        Get
            If m_TablesDisponibles Is Nothing Then
                m_TablesDisponibles = New List(Of String)({TD_88_90.Nom, TF_00_02.Nom, TH_00_02.Nom, NA_Empr_H.Nom, NA_Empr_F.Nom})
            End If
            Return m_TablesDisponibles
        End Get
    End Property

    Private m_NA_Empr_F As ITableMortalite
    Public ReadOnly Property NA_Empr_F As ITableMortalite Implements ITablesMortaliteFactory.NA_Empr_F
        Get
            If m_NA_Empr_F Is Nothing Then
                m_NA_Empr_F = New TableMortaliteF_EmprunteursNA
            End If
            Return m_NA_Empr_F
        End Get
    End Property

    Private m_NA_Empr_H As ITableMortalite
    Public ReadOnly Property NA_Empr_H As ITableMortalite Implements ITablesMortaliteFactory.NA_Empr_H
        Get
            If m_NA_Empr_H Is Nothing Then
                m_NA_Empr_H = New TableMortaliteH_EmprunteursNA
            End If
            Return m_NA_Empr_H
        End Get
    End Property

    Private m_TD_88_90 As ITableMortalite
    Public ReadOnly Property TD_88_90 As ITableMortalite Implements ITablesMortaliteFactory.TD_88_90
        Get
            If m_TD_88_90 Is Nothing Then
                m_TD_88_90 = New TableMortalite_TD_88_90
            End If
            Return m_TD_88_90
        End Get
    End Property

    Private m_TF_00_02 As ITableMortalite
    Public ReadOnly Property TF_00_02 As ITableMortalite Implements ITablesMortaliteFactory.TF_00_02
        Get
            If m_TF_00_02 Is Nothing Then
                m_TF_00_02 = New TableMortalite_TF_00_02
            End If
            Return m_TF_00_02
        End Get
    End Property

    Private m_TH_00_02 As ITableMortalite
    Public ReadOnly Property TH_00_02 As ITableMortalite Implements ITablesMortaliteFactory.TH_00_02
        Get
            If m_TH_00_02 Is Nothing Then
                m_TH_00_02 = New TableMortalite_TH_00_02
            End If
            Return m_TH_00_02
        End Get
    End Property

End Class
